import requests
import json

def get_order_hyperliquid(coin="BTC",nSigFigs=2):
    url = "https://api.hyperliquid.xyz/info"

    #nSigFigs   2   以1000为分界  3   以100为分界   4  以10为分界  5  以1为分界  
    payload = json.dumps({
      "type": "l2Book",
      "coin": coin,
      "nSigFigs": int(nSigFigs)
    })

    headers = {
      'Content-Type': 'application/json'
    }

    response = requests.request("POST", url, headers=headers, data=payload)
    return response.json()